//
//  MYLabel.m
//  yayi
//
//  Created by hxp on 16/3/17.
//  Copyright © 2016年 hxp. All rights reserved.
//

#import "MYLabel.h"

@implementation MYLabel
-(instancetype)initWithFrame:(CGRect)frame
{
    self = [super initWithFrame:frame];
    if (self) {
        
    }
    return self;
}
-(void)drawRect:(CGRect)rect{
    CGContextRef context =UIGraphicsGetCurrentContext();
    CGContextBeginPath(context);
    CGContextSetLineWidth(context,0.5);//线宽度
    CGContextSetStrokeColorWithColor(context,[UIColor colorWithRed:122/255.0 green:120/255.0 blue:120/255.0 alpha:1].CGColor);
    CGFloat lengths[] = {4,2};//先画4个点再画2个点
    CGContextSetLineDash(context,0, lengths,2); //注意2(count)的值等于lengths数组的
    CGContextMoveToPoint(context,rect.origin.x,rect.origin.y);
    CGContextAddLineToPoint(context,rect.origin.x + rect.size.width,rect.origin.y);
    CGContextStrokePath(context);
    CGContextClosePath(context);
}
@end
